﻿using System;
using UnityEngine.Rendering;
using UnityEngine;
using LuaInterface;

public class RenderTargetIdentifierWrap
{
	public static LuaMethod[] regs = new LuaMethod[]
	{
		new LuaMethod("New", _CreateRenderTargetIdentifier),
		new LuaMethod("GetClassType", GetClassType),
	};

	static LuaField[] fields = new LuaField[]
	{
	};

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int _CreateRenderTargetIdentifier(IntPtr L)
	{
		int count = LuaDLL.lua_gettop(L);


		if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(int)))
		{
			int arg0 = (int)LuaScriptMgr.GetNumber(L, 1);
			RenderTargetIdentifier obj = new RenderTargetIdentifier(arg0);
			LuaScriptMgr.PushValue(L, obj);
			return 1;
		}
		else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(RenderTexture)))
		{
			RenderTexture arg0 = LuaScriptMgr.GetUnityObject<RenderTexture>(L, 1);
			RenderTargetIdentifier obj = new RenderTargetIdentifier(arg0);
			LuaScriptMgr.PushValue(L, obj);
			return 1;
		}
		else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(BuiltinRenderTextureType)))
		{
			BuiltinRenderTextureType arg0 = LuaScriptMgr.GetNetObject<BuiltinRenderTextureType>(L, 1);
			RenderTargetIdentifier obj = new RenderTargetIdentifier(arg0);
			LuaScriptMgr.PushValue(L, obj);
			return 1;
		}
		else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
		{
			string arg0 = LuaScriptMgr.GetString(L, 1);
			RenderTargetIdentifier obj = new RenderTargetIdentifier(arg0);
			LuaScriptMgr.PushValue(L, obj);
			return 1;
		}
		else if (count == 0)
		{
			RenderTargetIdentifier obj = new RenderTargetIdentifier();
			LuaScriptMgr.PushValue(L, obj);
			return 1;
		}
		else
		{
			LuaDLL.luaL_error(L, "invalid arguments to method: RenderTargetIdentifier.New");
		}

		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetClassType(IntPtr L)
	{
		LuaScriptMgr.Push(L, typeof(RenderTargetIdentifier));
		return 1;
	}

	public static void Register(IntPtr L)
	{
		LuaScriptMgr.RegisterLib(L, "UnityEngine.Rendering.RenderTargetIdentifier", typeof(RenderTargetIdentifier), regs, fields, null);
	}
}

